//
//  USMediaPickerManager.h
//  us
//
//  Created by karry on 2025/4/15.
//

#import <Foundation/Foundation.h>
#import <PhotosUI/PhotosUI.h>
#import "USMediaResult.h"
#import <UniformTypeIdentifiers/UniformTypeIdentifiers.h>

typedef NS_ENUM(NSInteger, USPickerMediaType) {
    USPickerMediaType_Image = 0,
    USPickerMediaType_Video = 1,
    USPickerMediaType_Image_Video = 2
};


NS_ASSUME_NONNULL_BEGIN

@interface USMediaPickerManager : NSObject<PHPickerViewControllerDelegate>


/// 弹出选择器（支持多选图片+视频），自动保存并返回路径
/// type    0：图片， 1：视频     2：图片 + 视频
+ (void)presentPickerFrom:(UIViewController *)vc
                     type:(USPickerMediaType)type
                    limit:(NSInteger)limit
         didFinishPicking:(void (^)(void))didFinishPicking
          progressHandler:(void (^)(NSInteger current, NSInteger total))progressHandler
               completion:(void (^)(NSArray<USMediaResult *> *results))completion;



@end

NS_ASSUME_NONNULL_END
